package com.xbdun.facade.bmp.enumx;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class UserEnum {
	
	/**
	* @ClassName: UserSex
	* @Description: 用户获取性别
	* @author zhanggt 360730440@qq.com
	* @date 2017年3月21日 下午5:58:59
	*/
	public enum UserSexEnum{
		DEFAULT(0,"未设定"),MAN(1,"男"),WAN(2,"女");
		private int key;
		private String val;
		UserSexEnum(int key,String val){
			this.key = key;
			this.val = val;
		}
		public int getKey() {
			return key;
		}
		public String getVal() {
			return val;
		}
		public static UserSexEnum getEnum(int key){
			UserSexEnum resultEnum=null;
			UserSexEnum[] enumAry=UserSexEnum.values();
			for(int i=0;i<enumAry.length;i++){
				if(enumAry[i].getKey()==key){
					resultEnum=enumAry[i];
					break;
				}
			}
			return resultEnum;
		}
	}
	
	/**
	* @ClassName: UserInauTypeEnum
	* @Description: 员工的就职类型
	* @author zhanggt 360730440@qq.com
	* @date 2017年3月21日 下午5:58:59
	*/
	public enum UserInauTypeEnum{
		DEFAULT(4,"其他类型"),FORMAL(1,"正式员工"),TEMPRO(2,"临时员工"),PRACTICE(3,"实习员工");
		private int key;
		private String val;
		UserInauTypeEnum(int key,String val){
			this.key = key;
			this.val = val;
		}
		public int getKey() {
			return key;
		}
		public String getVal() {
			return val;
		}
		public static UserInauTypeEnum getEnum(int key){
			UserInauTypeEnum resultEnum=null;
			UserInauTypeEnum[] enumAry=UserInauTypeEnum.values();
			for(int i=0;i<enumAry.length;i++){
				if(enumAry[i].getKey()==key){
					resultEnum=enumAry[i];
					break;
				}
			}
			return resultEnum;
		}
		
		@SuppressWarnings({ "rawtypes", "unchecked" })
		public static List toList(){
			UserInauTypeEnum[] ary = UserInauTypeEnum.values();
			List list = new ArrayList();
			for(int i=0;i<ary.length;i++){
				Map<String,String> map = new HashMap<String,String>();
				map.put("key",ary[i].getKey()+"");
				map.put("desc", ary[i].getVal());
				list.add(map);
			}
			return list;
		}
	}
	
	
	/**
	* @ClassName: UserStatusEnum
	* @Description: 用户状态
	* @author zhanggt 360730440@qq.com
	* @date 2017年3月21日 下午6:04:40
	 */
	public enum UserStatusEnum{
		NOMAL(0,"正常"),LOCKED(1,"锁定"),TO_VERIFY(2,"待验证");
		private int key;
		private String val;
		UserStatusEnum(int key,String val){
			this.key = key;
			this.val = val;
		}
		public int getKey() {
			return key;
		}
		public String getVal() {
			return val;
		}
		public static UserStatusEnum getEnum(int key){
			UserStatusEnum resultEnum=null;
			UserStatusEnum[] enumAry=UserStatusEnum.values();
			for(int i=0;i<enumAry.length;i++){
				if(enumAry[i].getKey()==key){
					resultEnum=enumAry[i];
					break;
				}
			}
			return resultEnum;
		}
		
		@SuppressWarnings({ "rawtypes", "unchecked" })
		public static List toList(){
			UserStatusEnum[] ary = UserStatusEnum.values();
			List list = new ArrayList();
			for(int i=0;i<ary.length;i++){
				Map<String,String> map = new HashMap<String,String>();
				map.put("key",ary[i].getKey()+"");
				map.put("desc", ary[i].getVal());
				list.add(map);
			}
			return list;
		}
	}
	
	/**
	* @ClassName: UserEducationEnum
	* @Description: 员工的学历
	* @author zhanggt 360730440@qq.com
	* @date 2017年3月21日 下午5:58:59
	*/
	public enum UserEducationEnum{
		BOS(1,"博士"),YJS(2,"研究生"),BK(3,"本科"),ZK(4,"专科"),QT(5,"其他");
		private int key;
		private String val;
		UserEducationEnum(int key,String val){
			this.key = key;
			this.val = val;
		}
		public int getKey() {
			return key;
		}
		public String getVal() {
			return val;
		}
		public static UserEducationEnum getEnum(int key){
			UserEducationEnum resultEnum=null;
			UserEducationEnum[] enumAry=UserEducationEnum.values();
			for(int i=0;i<enumAry.length;i++){
				if(enumAry[i].getKey()==key){
					resultEnum=enumAry[i];
					break;
				}
			}
			return resultEnum;
		}
		
		@SuppressWarnings({ "rawtypes", "unchecked" })
		public static List toList(){
			UserEducationEnum[] ary = UserEducationEnum.values();
			List list = new ArrayList();
			for(int i=0;i<ary.length;i++){
				Map<String,String> map = new HashMap<String,String>();
				map.put("key",ary[i].getKey()+"");
				map.put("desc", ary[i].getVal());
				list.add(map);
			}
			return list;
		}
	}
	/**
	 * @ClassName: UserEffectEnum
	 * @Description: 员工生效状态
	 * @author wwq
	 * @date 2017年5月10日14:08:10
	 */
	public enum UserEffectEnum{
		EFFECT(1,"生效"),INEFFECT(2,"未生效");
		private int key;
		private String val;
		UserEffectEnum(int key,String val){
			this.key = key;
			this.val = val;
		}
		public int getKey() {
			return key;
		}
		public String getVal() {
			return val;
		}
		public static UserEffectEnum getEnum(int key){
			UserEffectEnum resultEnum=null;
			UserEffectEnum[] enumAry=UserEffectEnum.values();
			for(int i=0;i<enumAry.length;i++){
				if(enumAry[i].getKey()==key){
					resultEnum=enumAry[i];
					break;
				}
			}
			return resultEnum;
		}
		
		@SuppressWarnings({ "rawtypes", "unchecked" })
		public static List toList(){
			UserEffectEnum[] ary = UserEffectEnum.values();
			List list = new ArrayList();
			for(int i=0;i<ary.length;i++){
				Map<String,String> map = new HashMap<String,String>();
				map.put("key",ary[i].getKey()+"");
				map.put("desc", ary[i].getVal());
				list.add(map);
			}
			return list;
		}
	}
	/**
	 * @ClassName: UserEnabledEnum
	 * @Description: 员工启用状态
	 * @author wwq
	 * @date 2017年5月10日14:47:50
	 */
	public enum UserEnabledEnum{
		ENABLED(1,"启用"),DISABLED(2,"停用");
		private int key;
		private String val;
		UserEnabledEnum(int key,String val){
			this.key = key;
			this.val = val;
		}
		public int getKey() {
			return key;
		}
		public String getVal() {
			return val;
		}
		public static UserEnabledEnum getEnum(int key){
			UserEnabledEnum resultEnum=null;
			UserEnabledEnum[] enumAry=UserEnabledEnum.values();
			for(int i=0;i<enumAry.length;i++){
				if(enumAry[i].getKey()==key){
					resultEnum=enumAry[i];
					break;
				}
			}
			return resultEnum;
		}
		
		@SuppressWarnings({ "rawtypes", "unchecked" })
		public static List toList(){
			UserEnabledEnum[] ary = UserEnabledEnum.values();
			List list = new ArrayList();
			for(int i=0;i<ary.length;i++){
				Map<String,String> map = new HashMap<String,String>();
				map.put("key",ary[i].getKey()+"");
				map.put("desc", ary[i].getVal());
				list.add(map);
			}
			return list;
		}
	}
}
